$(function(){
	 var swiper = new Swiper('.badd', {
          pagination : '.swiper-pagination',
          paginationClickable :true,
             onInit: function(swiper){        //动画
                swiperAnimate(swiper);
                $.ajax({
			        type:"GET",
			        url:"../json/square.json",
			        async:true,
			        success:function(res){
			          // console.log(res)
			          var str = template('dlss',{dls:res});
			          $('.dls').html(str);
			        }
			     //    ,beforeSend:function (argument) {
   		           
        //         	},complete:function(){
				    //  // $(".circle").remove();
				   	// }
				   	
			          });
			    $.ajax({
			        type:"GET",
			        url:"../json/squaA.json",
			        async:true,
			        success:function(res){
			          // console.log(res)
			          var str = template('list_caidan',{lis:res});
			          $('.lis').html(str);

			        }
			       });

         },onSlideChangeEnd: function(swiper){
                swiperAnimate(swiper);
               
            },onTransitionEnd: function(swiper){
                $('.navs').eq(swiper.activeIndex)   //跟着下标滑动
                .addClass('aited')
                .siblings()
                .removeClass('aited');

            }
        });
           //下标
            $('.navs').click(function(){
                $(this).addClass('aited')
                .siblings()
                .removeClass('aited');
                swiper.slideTo($(this).index(), 1000)
                 // console.log( swiper)
            });
 var mySwiper = new Swiper('.banner', {
  pagination : '.swiper-pagination',
  paginationClickable :true,
  // 如果需要分页器
  autoplay:2000,//定时
  pagination: '.swiper-pagination',
});
           $.ajax({
			        type:"GET",
			        url:"../json/douyou.json",
			        async:true,
			        success:function(res){
			          // console.log(res)
			          var str = template('douyou',{douyou:res});
			          $('.douyou').html(str);

			        }
			       });
    
})

